<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content" >
        <form class="form-horizontal m" id="form-pc-add" th:object="${pc}">
			<div class="form-group hidden" >
				<label class="col-sm-3 control-label">公司ID：</label>
				<div class="col-sm-8">
					<input id="companyId" th:field="*{companyId}" name="companyId" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">返岗类别</label>
				<div class="col-sm-7 col-sm-offset-1">
					<select class="form-control" name="peopleId">
						<option value="执勤值守">执勤值守</option>
						<option value="医疗救助">医疗救助</option>
						<option value="交通保障">交通保障</option>
						<option value="生活保障">生活保障</option>
						<option value="志愿服务">志愿服务</option>
						<option value="企业复工">企业复工</option>
						<option value="农业生产">农业生产</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">返岗日期</label>
				<div class="col-sm-7 col-sm-offset-1">
					<input id="remark" name="remark" class="form-control" type="date">
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/pc"
		$("#form-pc-add").validate({
			rules:{
				peopleId:{
					required:true
				},
				remark:{
					required:true,
					date : true
				}
			},
			messages:{
				peopleId:{
				  "required":"返岗类型不能为空"
				},
				remark:{
					required:"日期为空",
					date:"日期格式不正确"
				}
			}
		});

		function submitHandler() {
	        if ($.validate.form()) {
	        	console.log($('#form-pc-add').serialize())
	            $.operate.save(prefix + "/add", $('#form-pc-add').serialize());
	        }
	    }
	</script>
</body>
</html>
